package pkg

import (
	"fmt"
	"net"

	"github.com/urfave/cli"
)

func Ns() cli.Command {
	return cli.Command{
		Name:  "ns",
		Usage: "Looks Up the NameServers for a Particular Host",
		Action: func(c *cli.Context) error {
			ns, err := net.LookupNS(c.Args().Get(0))
			if err != nil {
				return err
			}
			for _, nsv := range ns {
				fmt.Printf("ns: %s\n", nsv)
			}
			return nil
		},
	}
}
